#
# libgist build file
#

#
# This file is part of libgist.
#
# libgist is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# libgist is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with libgist; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
#

#
# REVISION HISTORY
#
# $HeadURL: http://libgist.googlecode.com/svn/branches/lazebnik_dev/src/CMakeLists.txt $
# $Id: CMakeLists.txt 179 2012-04-12 03:18:05Z libgist@gmail.com $
#

# Min cmake version
cmake_minimum_required(VERSION 2.8)

# Project name and version
project(gist)
set(gist_VERSION_MAJOR 0)
set(gist_VERSION_MINOR 0)
set(gist_VERSION_PATCH 94)
configure_file("${PROJECT_SOURCE_DIR}/version.cc.in"
               "${PROJECT_SOURCE_DIR}/version.cc")

# Library checks
find_package(Boost COMPONENTS thread REQUIRED)
if(Boost_FOUND)
   find_file(Boost_GIL gil_all.hpp PATHS "${Boost_INCLUDE_DIR}/boost/gil")
   if("${Boost_GIL}" STREQUAL "Boost_GIL-NOTFOUND")
      message(FATAL_ERROR "sorry, libgist needs Boost.GIL")
   endif()
endif(Boost_FOUND)

# Libraries to link in
set(gist_LIBS ${Boost_LIBRARIES})

# Compiler flags
add_definitions(-Wall -Wextra)

# Source files for driver program
set(gist_SOURCES version.cc settings.cc image_utils.cc lazebnik.cc)

# Final output from sources
add_library(gist SHARED ${gist_SOURCES})
add_library(gist_static STATIC ${gist_SOURCES})
set_target_properties(gist_static PROPERTIES OUTPUT_NAME gist)
set_target_properties(gist_static PROPERTIES PREFIX lib)
target_link_libraries(gist ${gist_LIBS})
